package com.cqgc.entity;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {
    private Integer code;// 状态码
    private String message;// 返回信息
    private Object data;// 数据

    private Result(){}


    //增删改 成功响应
    public static Result success(){
        return new Result(0,"success",null);
    }
    //查询 成功响应
    public static Result success(Object data){
        return new Result(0,"success",data);
    }
    //失败响应
    public static Result error(String msg){
        return new Result(1,msg,null);
    }
}
